<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"> 
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script type="text/javascript">
        function submitForm() {

            var phone = $("input[name='phone']").val();
            var name = $("#input[name='name']").val();
            var message = $("input[name='message']").val();
            var site = $("input[name='site']").val();
            // http://39.106.222.102:8889/publish/test
            $.ajax({
                type: "post",
                url: "http://localhost:8889/publish/test",
                crossDomain: true,
                data: JSON.stringify({
                    "phone": phone,
                    "name": name,
                    "message": message,
                    "site": site
                }),
                contentType: "application/xml ;/json; charset=utf-8"
            }).done(function (data) {
                alert(data);
            })
                .fail(function (jqXHR, textStatus, errorThrown) {
                    alert(errorThrown);
                })
        }
    </script>
</head>
<body>

<form>
    phone: <input type="text" name="phone"/><br/>
    name:<input type="text" name="name"/><br/>
    message： <input type="text" name="message"/><br/>
    site： <input type="text" name="site"/><br/>
    <input type="button" onclick="submitForm()"/><br/>
</form>


</body>

</html>